package com.gxuwz.attend.service.Impl;

import com.gxuwz.attend.dao.LeaveDao;
import com.gxuwz.attend.entity.Leave;
import com.gxuwz.attend.service.LeaveService;

import java.util.List;

public class LeaveServiceImpl implements LeaveService {
    private LeaveDao leaveDao;

    public void setLeaveDao(LeaveDao leaveDao) {
        this.leaveDao = leaveDao;
    }

    /**
     * 添加请假数据
     * @param leave
     */
    @Override
    public void insertLeave(Leave leave){
        leaveDao.insertLeave(leave);
    }

    /**
     * 删除请假数据
     * @param id
     */
    @Override
    public void deleteLeave(String id){
        leaveDao.deleteLeave(id);
    }

    /**
     * 更新请假数据
     * @param leave
     */
    @Override
    public void updateLeave(Leave leave){
        leaveDao.updateLeave(leave);
    }

    /**
     * 查询全部请假数据
     * @return
     */
    @Override
    public List<Leave> queryLeaves(){
        return leaveDao.queryLeaves();
    }

    /**
     * 模糊查询请假数据
     * @param leave
     * @return
     */
    @Override
    public List<Leave> queryLeave(Leave leave){
        return leaveDao.queryLeave(leave);
    }

}
